local table_name = "swstage"
local old_table = IMPORT_D:get_table(table_name)
if not old_table then
    return
end

local new_table = {}
for _, tbl in pairs(table.copy(old_table)) do repeat
    if not tbl.id then
        break
    end

    local swid = tbl.id

    -- 牢笼奖励物品数组
    if type(tbl.swWelfare) == "string" then
        local swWelfare = {}
        for _, val in ipairs(string.split(tbl.swWelfare, ";")) do
            table.insert(swWelfare, tonumber(val))
        end
        tbl.swWelfare = swWelfare
    end

    -- 奖励系数比
    tbl.swdropNum = tonumber(tbl.swdropNum) * 100

    -- 牢笼奖励发放概率权重
    if type(tbl.swWelfareWeight) == "string" then
        local swWelfareWeight = {}
        for _, val in ipairs(string.split(tbl.swWelfareWeight, ";")) do
            table.insert(swWelfareWeight, tonumber(val))
        end
        tbl.swWelfareWeight = swWelfareWeight
    end

    -- 牢笼刷新权重，对应1-6牢笼
    if type(tbl.swRefreshWeight) == "string" then
        local swRefreshWeight = {}
        for _, val in ipairs(string.split(tbl.swRefreshWeight, ";")) do
            table.insert(swRefreshWeight, tonumber(val))
        end
        tbl.swRefreshWeight = swRefreshWeight
    end

    new_table[swid] = tbl
until true end

IMPORT_D:set(table_name, new_table)
